#!/bin/sh
mkdir -p logs
cat mass_build_2225_failures.csv | while read -r line
do
	name="$(echo "$line" | awk -F ';;' '{print $3}' | awk -F '/' '{print $NF}')"
	if [ -f "logs/${name}.gz" ]; then continue; fi
	log="$(echo "$line" | awk -F ';;' '{print $NF}' | sed -e 's,?show=true,,g')"
	wget "$log" -O "logs/${name}.gz"
done
cd logs
for i in *.gz
do
	gunzip --force "$i"
done 
cd -
